﻿@using SH = EMoney.IStock.Client.Framework.StringHelper;
@using System.Data;
@{
    DataTable logbt = (DataTable)ViewBag.log;
    }
<style type="text/css">
    #jptb .act{text-align:center;color:RGB(88,142,212);font-size:14px;font-weight:bold;}
    #jptb td{height:66px;border-top-style: dashed; border-top-width: 1px; border-top-color: #ccc;padding-top:10px;padding-bottom:10px;
    }

    .act div{border-right-style:solid; border-right-width: 1px; border-right-color: RGB(213,213,213);height:30px;
             width:70%;margin-left:auto;margin-right:auto;line-height:30px;padding-right:10px;
    }
    a.hui{color:#ccc; text-decoration: none;}
    .mes{line-height:30px;}
    .span-actname{color:red;}
    .actmes{color:RGB(27,136,203);line-height:20px;}

    #jptb .time{color:RGB(182,182,182);text-align:right;padding-right:20px;font-size:12px;}

    .bgcolor{background-color:RGB(248,248,248);}

</style>
<div class="ind_l">
    <div class="adk_1" style="width:100%;">
        <div id="scrollBox1" class="scrollBox" scrollflag style="height:245px;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="jptb">
                @foreach(DataRow row in logbt.Rows)
                {
                    <tr>
                        <td width="18%" class="act"><div>@row["actname"]</div></td>
                        <td width="50%" class="mes">
                            <div class="actname"><span class="span-actname">@row["name"]</span>
                                <a href="#" class="hui copyA hui" data="@row["img"]" id="" onclick="showimg(this);">[使用说明]</a>
                            </div>
                            <div class="actmes">
                                @if (row["name"].ToString().IndexOf("爱代价")>=0)
                                {
                                    <a href="#" onclick="showimgbyurl('http://static.emoney.cn/www/emfastock/img/cj/idj.jpg');">点击打开二维码</a>
                                }
                                else
                                {
                                    <span>优惠券卡号:@Html.Raw(row["card"])<br />优惠券密码:
                                        @if(string.IsNullOrEmpty(row["pwd"].ToString()))
                                        {
                                            @Html.Raw("无");
                                        }
                                        else
                                        {
                                            @Html.Raw(row["pwd"]);
                                        }
                                    </span>
                                    <a href="#" class="hui copyA hui" id="copyA" onclick="clipboard(this);">[复制]</a>
                                }
                            </div>
                        </td>
                        <td class="time">@row["createtime"]</td>
                    </tr>
                }
            </table>
        </div>
    </div>
</div>
<div id="imgdialog" class="" style="display:none; position:absolute;top:20px;left:30px; width:100%;background-color:white;z-index:10000000;width:600px;height:250px;border: 1px solid RGB(86,142,212);">
    <div id="imgclose" style="position:absolute;left:555px;top:5px;">
        <img src="http://static.emoney.cn/www/emfastock/img/cj/close.png" alt="" onclick="closeimg();" />
    </div>
    <img src="http://static.emoney.cn/www/emfastock/img/cj/1.jpg" alt="" width="600" height="250" id="demoimg" />
</div>
<div class="ind_r" id="divAd"></div>

<script type="text/javascript">


    $(document).ready(function () {
        $("#jptb tr").hover(function () {
            $(this).toggleClass("bgcolor")
        });
    });

    $("#scrollBox1").height(270);

    $(".scrollBox").jscroll({ W: "8px", IW: "8px", CurrT: 0, Bar: { Pos: "up" }, Btn: { btn: false }, Fn: function () { } }).hover(function (e) {
        var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
        if (!scrlbr.hasClass("non")) {
            scrlbr.addClass("mon").stop(true, true, false).show();
        }
    }, function (e) {
        var thisbx = $(this), scrlbr = $(this).find(".jscroll-e");
        if (!scrlbr.hasClass("non")) {
            scrlbr.removeClass("mon");
            if (scrlbr.hasClass("vxdrag")) { } else {
                //scrlbr.fadeOut("slow");
            }
        }
    });

    ReSetScroll();

    function showimg(box)
    {
        var imgurl = $(box).attr("data");
        $("#imgdialog #demoimg").attr("src", imgurl);
        $("#imgdialog").show('0.5');
    }

    function showimgbyurl(url)
    {
        $("#imgdialog #demoimg").attr("src", url);
        $("#imgdialog").show('0.5');
    }

    function closeimg() {
        $("#imgdialog").hide('0.5');
    }

    function clipboard(box) {
        var Data = $(box).parent().find("span").text();
        if (window.clipboardData) {
            window.clipboardData.clearData();
            window.clipboardData.setData("Text", Data);
            //alert("已复制到剪切板！")
            $(box).text("已复制");
        } else if (navigator.userAgent.indexOf("Opera") != -1) {
            window.location = Data;
            //alert("已复制到剪切板！");
            $(box).text("已复制");
        } else if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                //alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将 'signed.applets.codebase_principal_support'设置为'true'");
                $(box).text("失败");
            }
            var clip = Components.classes['@@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
            if (!clip)
                return;
            var trans = Components.classes['@@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (!trans)
                return;
            trans.addDataFlavor('text/unicode');
            var str = new Object();
            var len = new Object();
            var str = Components.classes["@@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext = Data;
            str.data = copytext;
            trans.setTransferData("text/unicode", str, copytext.length * 2);
            var clipid = Components.interfaces.nsIClipboard;
            if (!clip)
                return false;
            clip.setData(trans, null, clipid.kGlobalClipboard);
            //alert("已复制到剪切板！")
            $(box).text("已复制");
        }
    }
</script>
